﻿var user_menu_expanded = 0;
var admin_menu_expanded = 0;

function init_user_menu()
{
    document.getElementById('content-id').style.backgroundImage = 'radial-gradient(top center, 50% 10px, rgba(62, 96, 111, 0.75), rgba(255, 255, 255, 1))';
    document.getElementById('content-id').style.backgroundImage = '-o-radial-gradient(top center, 50% 10px, rgba(62, 96, 111, 0.75), rgba(255, 255, 255, 1))';
    document.getElementById('content-id').style.backgroundImage = '-moz-radial-gradient(top center, 50% 10px, rgba(62, 96, 111, 0.75), rgba(255, 255, 255, 1))';
    document.getElementById('content-id').style.backgroundImage = '-webkit-radial-gradient(top center, 50% 10px, rgba(62, 96, 111, 0.75), rgba(255, 255, 255, 1))';
    document.getElementById('content-id').style.marginTop = '0px';
    document.getElementById('background-middle-menu-id').style.height = '40px';
    document.getElementById('middle-menu-id').style.marginTop = '-40px';
    document.getElementById('background-user-menu-id').style.height = '0px';
    document.getElementById('user-menu-id').style.height = '0px';
    document.getElementById('user-menu-id').style.marginTop = '0px';
    user_menu_expanded = 0;
}

function init_admin_menu()
{
    document.getElementById('content-id').style.backgroundImage = 'radial-gradient(top center, 50% 10px, rgba(62, 96, 111, 0.75), rgba(255, 255, 255, 1))';
    document.getElementById('content-id').style.backgroundImage = '-o-radial-gradient(top center, 50% 10px, rgba(62, 96, 111, 0.75), rgba(255, 255, 255, 1))';
    document.getElementById('content-id').style.backgroundImage = '-moz-radial-gradient(top center, 50% 10px, rgba(62, 96, 111, 0.75), rgba(255, 255, 255, 1))';
    document.getElementById('content-id').style.backgroundImage = '-webkit-radial-gradient(top center, 50% 10px, rgba(62, 96, 111, 0.75), rgba(255, 255, 255, 1))';
    document.getElementById('content-id').style.marginTop = '0px';
    document.getElementById('background-middle-menu-id').style.height = '40px';
    document.getElementById('middle-menu-id').style.marginTop = '-40px';
    document.getElementById('background-admin-menu-id').style.height = '0px';
    document.getElementById('admin-menu-id').style.height = '0px';
    document.getElementById('admin-menu-id').style.marginTop = '0px';
    admin_menu_expanded = 0;
}

function expand_user_menu()
{
    init_admin_menu();
    if (user_menu_expanded == 0)
    {
        document.getElementById('home-id').style.backgroundImage = 'none';
        document.getElementById('admin-id').style.backgroundImage = 'none';
        document.getElementById('contact-id').style.backgroundImage = 'none';
        document.getElementById('about-id').style.backgroundImage = 'none';

        document.getElementById('user-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('user-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('user-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('user-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';

        document.getElementById('content-id').style.marginTop = '-40px';
        document.getElementById('background-middle-menu-id').style.height = '41px';
        document.getElementById('middle-menu-id').style.marginTop = '-41px';
        document.getElementById('background-user-menu-id').style.height = '40px';
        document.getElementById('user-menu-id').style.marginTop = '-40px';
        document.getElementById('user-menu-id').style.height = '40px';
        user_menu_expanded = 1;
    }
    else
    {
        init_user_menu();
    }
}

function expand_admin_menu()
{
    init_user_menu();
    if (admin_menu_expanded == 0)
    {
        document.getElementById('home-id').style.backgroundImage = 'none';
        document.getElementById('user-id').style.backgroundImage = 'none';
        document.getElementById('contact-id').style.backgroundImage = 'none';
        document.getElementById('about-id').style.backgroundImage = 'none';

        document.getElementById('admin-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('admin-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('admin-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('admin-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';

        document.getElementById('content-id').style.marginTop = '-40px';
        document.getElementById('background-middle-menu-id').style.height = '41px';
        document.getElementById('middle-menu-id').style.marginTop = '-41px';
        document.getElementById('background-admin-menu-id').style.height = '40px';
        document.getElementById('admin-menu-id').style.height = '40px';
        document.getElementById('admin-menu-id').style.marginTop = '-40px';
        admin_menu_expanded = 1;
    }
    else
    {
        init_admin_menu();
    }
}

function show_menu()
{
    if (window.location.hash == "#home" || window.location.hash == "")
    {
        document.getElementById('home-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('home-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('home-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('home-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
    }
    else if (window.location.hash == "#user" || window.location.hash == "#user-flights" || window.location.hash == "#user-members-edit" || window.location.hash == "#user-transactions-credit")
    {
        document.getElementById('user-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('user-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('user-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('user-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
        if (window.location.hash == "#user-flights")
        {
            document.getElementById('user-flights-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('user-flights-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('user-flights-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('user-flights-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
        }
        else if (window.location.hash == "#user-members-edit")
        {
            document.getElementById('user-members-edit-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('user-members-edit-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('user-members-edit-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('user-members-edit-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
        }
        else if (window.location.hash == "#user-transactions-credit")
        {
            document.getElementById('user-transactions-credit-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('user-transactions-credit-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('user-transactions-credit-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('user-transactions-credit-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
        }
        expand_user_menu();
    }
    else if (window.location.hash == "#admin" || window.location.hash == "#admin-members-crud" || window.location.hash == "#admin-planes" || window.location.hash == "#admin-flights")
    {
        document.getElementById('admin-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('admin-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('admin-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('admin-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
        if (window.location.hash == "#admin-members-crud")
        {
            document.getElementById('admin-members-crud-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('admin-members-crud-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('admin-members-crud-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('admin-members-crud-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
        }
        else if (window.location.hash == "#admin-planes")
        {
            document.getElementById('admin-planes-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('admin-planes-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('admin-planes-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('admin-planes-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
        }
        else if (window.location.hash == "#admin-flights")
        {
            document.getElementById('admin-flights-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('admin-flights-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('admin-flights-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
            document.getElementById('admin-flights-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.6) 50%, rgba(252, 255, 245, 0))';
        }
        expand_admin_menu();
    }
    else if (window.location.hash == "#contact")
    {
        document.getElementById('contact-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('contact-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('contact-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('contact-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
    }
    else if (window.location.hash == "#about")
    {
        document.getElementById('about-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('about-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('about-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
        document.getElementById('about-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
    }
}

function back_to_home()
{
    document.getElementById('user-id').style.backgroundImage = 'none';
    document.getElementById('admin-id').style.backgroundImage = 'none';
    document.getElementById('home-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
    document.getElementById('home-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
    document.getElementById('home-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
    document.getElementById('home-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
}

function back_to_contact()
{
    document.getElementById('user-id').style.backgroundImage = 'none';
    document.getElementById('admin-id').style.backgroundImage = 'none';
    document.getElementById('contact-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
    document.getElementById('contact-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
    document.getElementById('contact-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
    document.getElementById('contact-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
}

function back_to_about()
{
    document.getElementById('user-id').style.backgroundImage = 'none';
    document.getElementById('admin-id').style.backgroundImage = 'none';
    document.getElementById('about-id').style.backgroundImage = 'linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
    document.getElementById('about-id').style.backgroundImage = '-o-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
    document.getElementById('about-id').style.backgroundImage = '-moz-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
    document.getElementById('about-id').style.backgroundImage = '-webkit-linear-gradient(left, rgba(252, 255, 245, 0), rgba(252, 255, 245, 0.25) 50%, rgba(252, 255, 245, 0))';
}

